package com.stool.gramalldata;

import com.stool.core.Classifier;
import com.stool.core.ModelClassifier;
import com.stool.gramalldata.config.DLmodelsProperties;
import com.stool.pojo.ModelConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class GramAllDataApplication {

    public static void main(String[] args) {
        SpringApplication.run(GramAllDataApplication.class, args);
    }

    @Autowired
    private DLmodelsProperties properties;

    @Bean
    public Classifier createClassifier(){
        ModelConfiguration configuration = new ModelConfiguration();
        configuration.setNumberLabel(2)
                     .setModelDir(properties.getDir());
        Classifier classifier = ModelClassifier.getClassifier(configuration);
        return classifier;
    }

}
